﻿@model IEnumerable<Employee>

@{
    ViewBag.Title = "Index";
}

<h2>列表</h2>

<p>
    @Html.ActionLink("创建", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Department.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ExternalId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Job.JobTitle)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Contract.Salary)
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Department.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ExternalId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Job.JobTitle)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Contract.Salary)
        </td>
        <td>
            @Html.ActionLink("编辑", "Edit", new { id=item.Id }) |
            @Html.ActionLink("详情", "Details", new { id=item.Id }) |
            @Html.ActionLink("删除", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
